package com.scorpio.scwallet.service.impl;

import com.scorpio.common.annotation.DataSource;
import com.scorpio.common.enums.DataSourceType;
import com.scorpio.common.service.impl.BaseServiceImpl;
import com.scorpio.scwallet.domain.WalletRecordEntity;
import com.scorpio.scwallet.mapper.WalletRecordMapper;
import com.scorpio.scwallet.service.WalletRecordService;
import org.springframework.stereotype.Service;

@Service
@DataSource(DataSourceType.SLAVE)
public class WalletRecordServiceImpl extends BaseServiceImpl<WalletRecordMapper, WalletRecordEntity> implements WalletRecordService {

    @Override
    public int countPayChatTotali(Long userId, Long toUserId) {
        return baseDao.selectCount(getQueryWrapper().eq("from_uid", userId).eq("obj_id", toUserId));
    }
}
